<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<style type="text/css">
		    div {
		        font-size: 1.6rem;
		        color: lightblue;
		        border: 1px solid lightblue;
		        width: 2rem;
		        height: 2rem;
		        text-align: center;
		        position: fixed;
		        right: 1rem;
		        bottom: 1rem;
		        cursor: pointer;
		    }
			p {
			        width: 100px;
			        height: 800px;
			        border: 1px solid pink;
			    }
		</style>
		<p></p>
		<p></p>
		<p></p>
		<p></p>
		<p></p>
		<div onclick="stop()">↑</div>
		<script type="text/javascript">
			//设计一个程序，点击回到顶部按钮时，不是瞬时回到顶部，而是在1秒内逐渐回到顶部。
			function stop(){
				window.scrollTo({
					top:0,
					behavior:"smooth",
				});
			}
		</script>
	</body>
</html>
